extends CanvasLayer
signal back_pressed
@export var upgrades: Array[MetaUpgrade] = []
@onready var grid_container = %GridContainer
@onready var back_button = %BackButton

var meta_upgrade_card_scene = preload("res://scenes/ui/meta_upgrade_card.tscn")


func _ready():
	back_button.pressed.connect(on_back_pressed)
	for upgrade in upgrades:
		var meta_upgrade_card_instance = meta_upgrade_card_scene.instantiate()
		grid_container.add_child(meta_upgrade_card_instance)
		meta_upgrade_card_instance.set_meta_upgarde(upgrade)


func on_back_pressed():
	back_pressed.emit()
